package com.study.lagou.edu.service.impl;

import com.study.lagou.edu.dao.AuthCodeLogDao;
import com.study.lagou.edu.pojo.AuthCode;
import com.study.lagou.edu.service.IAuthCodeLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

@Service
public class AuthCodeLogServiceImpl implements IAuthCodeLogService {

    @Autowired
    private AuthCodeLogDao authCodeLogDao;

    @Override
    public Page<AuthCode> findAll(int pageSize, int currentPage) {
        PageRequest pageRequest = PageRequest.of(currentPage - 1, pageSize);
        return authCodeLogDao.findAll(pageRequest);
    }
}
